<?php
	include_once("Login.php");
	
	$conn = new mysqli($host,$user,$passwd, $database)
	or die("SQL connect error: ".mysqli_connect_error());
	
	$body = file_get_contents('php://input');
	$xml = simplexml_load_string($body);
	
	$cloudId = $xml->cloudId;
	$place = $xml->place;
	$isCurrentLocation = $xml->isCurrentLocation;
	$query = "INSERT INTO Places (CloudId, Place, IsCurrentLocation) VALUES ('$cloudId', '$place', '$isCurrentLocation')";
	
	mysqli_query($conn, $query);
	
	$id =  mysqli_insert_id($conn);
	
	echo "<node><insertId>$id</insertId></node>";
	
	mysqli_close($conn);
?>